﻿using System;
using System.Windows.Controls;
using System.Windows;

namespace Simp.Interpreter
{
	/// <summary>Error output control:  displays errors.</summary>
	public partial class GraphOutputUserControl : UserControl
	{
		/// <summary>Constructor.</summary>
		public GraphOutputUserControl()
		{
			InitializeComponent();
		}

		#region OriginalContent Property
		private static readonly DependencyProperty ModelledCanvasProperty = DependencyProperty.Register(
			"ModelledCanvas",
			typeof(Canvas),
			typeof(GraphOutputUserControl),
			new UIPropertyMetadata(null, OnModelChanged));

		/// <summary>Canvas to display.</summary>
		public Canvas ModelledCanvas
		{
			get { return (Canvas)GetValue(ModelledCanvasProperty); }
			set { SetValue(ModelledCanvasProperty, value); }
		}
		#endregion

		private static void OnModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			GraphOutputUserControl graphOutputUserControl = (GraphOutputUserControl)d;

			graphOutputUserControl.maxContentControl.Content = e.NewValue;
		}
	}
}